package com.wondersgroup.yly.rest;

import com.wondersgroup.yly.dto.DemoDTO;
import com.wondersgroup.yly.dto.ExampleDTO;
import com.wondersgroup.yly.vs.ReliableVs;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RequestMapping("tests")
@RestController
public class TestController {

	@Autowired
	ReliableVs reliableVs;

	@PostMapping("test-insert")
	public void tccTest1(@RequestBody ExampleDTO exampleDTO) {
		log.info("log4j ==> enter controller test ....");
		log.info("parameter are :{}", exampleDTO);
		reliableVs.tccTest2(exampleDTO);
	}

	@PostMapping("insert-update")
	public void tccTest(@RequestBody ExampleDTO exampleDTO) {
		log.info("log4j ==> enter controller test ....");
		log.info("parameter are :{}", exampleDTO);
		reliableVs.tccTest(exampleDTO);
	}

	@PostMapping("test-update")
	public void update(@RequestBody DemoDTO demoDTO) {
		log.info("log4j ==> enter controller test ....");
		log.info("parameter are :{}", demoDTO);
		reliableVs.updateTest(demoDTO);
	}
}
